package coffe.tea;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class TeaWithHook extends CaffeineBeverageWithHook{

	
	public void brew() {
		System.out.println("Steeping the tea");
		
	}

	@Override
	public void addCondiments() {
		System.out.println("Adding lemon");
	}

	public boolean customerWantsCondiments(){
		String answer = getUserInput();
		
		if(answer.toLowerCase().startsWith("y")) return true;
		else return false;
		
	}
	
	private String getUserInput(){
		String answer = null;
		System.out.println("Would you like lemon with your tea?(y/n");
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		
		try {
			answer = in.readLine();
			
		} catch (Exception e) {
			System.err.println("IO Error trying to read your answer");
		}
		if(answer == null) return "no";
		return answer;
	}
}
